<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- saved from url=(0086)http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/lzw.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><script src="./LZW and GIF explained_files/analytics.js(1).download" type="text/javascript"></script>
<script type="text/javascript">window.addEventListener('DOMContentLoaded',function(){var v=archive_analytics.values;v.service='wb';v.server_name='wwwb-app104.us.archive.org';v.server_ms=612;archive_analytics.send_pageview({});});</script><script type="text/javascript" src="./LZW and GIF explained_files/playback.bundle.js.download" charset="utf-8"></script>
<script type="text/javascript" src="./LZW and GIF explained_files/wombat.js.download" charset="utf-8"></script>
<script type="text/javascript">
  __wm.init("http://web.archive.org/web");
  __wm.wombat("http://www.danbbs.dk:80/~dino/whirlgif/lzw.html","20050217131148","http://web.archive.org/web/","web","/_static/",
	      "1108645908","www.danbbs.dk:80");
</script>
<link rel="stylesheet" type="text/css" href="./LZW and GIF explained_files/banner-styles.css">
<link rel="stylesheet" type="text/css" href="./LZW and GIF explained_files/iconochive.css">
<!-- End Wayback Rewrite JS Include -->

   
   <meta name="description" content="usage notes">
   <title>LZW and GIF explained</title>
<link rel="toc" href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/index.html" title="Whirlgif">
<link href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/download.html" title="Download">
<link href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/whirlgifman.html" title="
Manual">
<link href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/examples.html" title="Examples">
<link href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gif87.html" title="GIF87">
<link href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gif89.html" title="GIF89">
</head>
<body text="#000000" bgcolor="#FFC08D" background="./LZW and GIF explained_files/brun.jpg" link="#0000FF" vlink="#800000" alink="#FF0000"><!-- BEGIN WAYBACK TOOLBAR INSERT -->
<style type="text/css">
body {
  margin-top:0 !important;
  padding-top:0 !important;
  /*min-width:800px !important;*/
}
</style>
<script>__wm.rw(0);</script>
<div id="wm-ipp-base" lang="en" style="display: block; direction: ltr;">
</div><div id="donato" style="position:relative;width:100%;">
  <div id="donato-base">
    <iframe id="donato-if" src="./LZW and GIF explained_files/donate.html" scrolling="no" frameborder="0" style="width:100%; height:100%">
    </iframe>
  </div>
</div><script type="text/javascript">
__wm.bt(625,27,25,2,"web","http://www.danbbs.dk/~dino/whirlgif/lzw.html","20050217131148",1996,"/_static/",["/_static/css/banner-styles.css?v=NHuXCfBH","/_static/css/iconochive.css?v=qtvMKcIJ"]);
  __wm.rw(1);
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/download.html">Download Whirlgif</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/whirlgifman.html">Whirlgif Manual</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/examples.html">Examples</a>]
 [LZW explained]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gif87.html">GIF 87a Spec</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gif89.html">GIF 89a Spec</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/index.html">Whirlgif 3.x Homepage</a>]
<hr>


The following document was originally published by Michael A. Mayer. It  used to be accessible as
<u>http://www.seas.upenn.edu/~mmayer/lzw_gif/lzw.html</u>.
Michael A. Mayer said in his foreword that he <i>simply added the 
<a href="http://web.archive.org/web/20050217131148/http://www.w3.org/hypertext/WWW/MarkUp/MarkUp.html">HTML</a> 
formatting (and made minor edits as appropriate)</i> and that <i>the original 
document was downloaded by anonymous ftp from
<a href="http://web.archive.org/web/20050217131148/ftp://zamenhof.cs.rice.edu/pub/graphics.formats/lzw.and.gif.doc">
zamenhof.cs.rice.edu</a></i>
(certain syntactical corrections were made by <a href="http://web.archive.org/web/20050217131148/mailto:dino@danbbs.dk">Hans Dinsen-Hansen</a>).

<p>
Together with this document Michael A. Mayer published two algorithms: <a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gifcode.html">gifcode.c</a>
and  <a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/igifcode.html">igifcode.c</a> which helped me understand Steve Blackstock's article. I have decided to publish them here as they do not seem to be accessible anywhere else


</p><hr>
<a name="top"></a>
<h1>
John Barkaus's "LZW and GIF explained"
</h1>

<hr>


<p>
</p><pre><i>
&gt;From: john@cooper.cooper.EDU (John Barkaus)
Newsgroups: comp.graphics
Subject: GIF file format responses 5/5
Date: 21 Apr 89 20:58:01 GMT
Organization: The Cooper Union (NY, NY)
</i></pre>

<p>
</p><center><h3>LZW and GIF explained----Steve Blackstock</h3></center>

<p>
I hope this little document will help enlighten those of you out there
who want to know more about the Lempel-Ziv Welch compression algorithm, and,
specifically, the implementation that GIF uses.

</p><p>
Before we start, here's a little terminology, for the purposes of this
document:

</p><p></p><dl>
<dt>"character":</dt><dd> a fundamental data element. In normal text files, this is
just a single byte. In raster images, which is what we're interested in, it's
an index that specifies the color of a given pixel. I'll refer to an arbitray
character as "K".
</dd><dt>"charstream":</dt><dd> a stream of characters, as in a data file.
</dd><dt>"string":</dt><dd> a number of continuous characters, anywhere from one to very
many characters in length. I can specify an arbitrary string as "[...]K".
</dd><dt>"prefix":</dt><dd> almost the same as a string, but with the implication that a
prefix immediately precedes a character, and a prefix can have a length of
zero. So, a prefix and a character make up a string. I will refer to an
arbitrary prefix as "[...]".
</dd><dt>"root":</dt><dd> a single-character string. For most purposes, this is a
character, but we may occasionally make a distinction. It is [...]K, where
[...] is empty.
</dd><dt>"code":</dt><dd> a number, specified by a known number of bits, which maps to a
string.
</dd><dt>"codestream":</dt><dd> the output stream of codes, as in the "raster data"
</dd><dt>"entry":</dt><dd> a code and its string.
</dd><dt>"string table":</dt><dd> a list of entries; usually, but not necessarily, unique.
</dd></dl>
  

<p>
That should be enough of that.

</p><p>
LZW is a way of compressing data that takes advantage of repetition of
strings in the data. Since raster data usually contains a lot of this
repetition, LZW is a good way of compressing and decompressing it.

</p><p>
For the moment, lets consider normal LZW encoding and decoding. GIF's
variation on the concept is just an extension from there.

</p><p>
LZW manipulates three objects in both compression and decompression:&nbsp;&nbsp; the
charstream, the codestream, and the string table. In compression, the
charstream is the input and the codestream is the output. In decompression,
the codestream is the input and the charstream is the output. The string table
is a product of both compression and decompression, but is never passed from
one to the other.

</p><p>
The first thing we do in LZW compression is initialize our string table.&nbsp;&nbsp;
To do this, we need to choose a code size (how many bits) and know how many
values our characters can possibly take.&nbsp;&nbsp; Let's say our code size is 12 bits,
meaning we can store 0-&gt;FFF, or 4096 entries in our string table.&nbsp;&nbsp; Lets also
say that we have 32 possible different characters.&nbsp;&nbsp; (This corresponds to, say,
a picture in which there are 32 different colors possible for each pixel.)&nbsp; To
initialize the table, we set code#0 to character#0, code #1 to character#1,
and so on, until code#31 to character#31.&nbsp;&nbsp; Actually, we are specifying that
each code from 0 to 31 maps to a root.&nbsp;&nbsp; There will be no more entries in the
table that have this property.

</p><p>
Now we start compressing data.&nbsp;&nbsp; Let's first define something called the
"current prefix".&nbsp;&nbsp; It's just a prefix that we'll store things in and compare
things to now and then.&nbsp;&nbsp; I will refer to it as "[.c.]".&nbsp;&nbsp; Initially, the current
prefix has nothing in it.&nbsp;&nbsp; Let's also define a "current string", which will be
the current prefix plus the next character in the charstream.&nbsp;&nbsp; I will refer to
the current string as "[.c.]K", where K is some character.&nbsp;&nbsp; OK, look at the
first character in the charstream.&nbsp;&nbsp; Call it P.&nbsp;&nbsp; Make [.c.]P the current string.&nbsp;&nbsp;
(At this point, of course, it's just the root P.)&nbsp; Now search through the
string table to see if [.c.]P appears in it.&nbsp;&nbsp; Of course, it does now, because
our string table is initialized to have all roots.&nbsp;&nbsp; So we don't do anything.&nbsp;&nbsp;
Now make [.c.]P the current prefix.&nbsp;&nbsp; Look at the next character in the
charstream.&nbsp;&nbsp; Call it Q.&nbsp;&nbsp; Add it to the current prefix to form [.c.]Q, the
current string.&nbsp;&nbsp; Now search through the string table to see if [.c.]Q appears
in it.&nbsp;&nbsp; In this case, of course, it doesn't.&nbsp;&nbsp; Aha!&nbsp; Now we get to do something.&nbsp;&nbsp;
Add [.c.]Q (which is PQ in this case) to the string table for code#32, and
output the code for [.c.] to the codestream.&nbsp;&nbsp; Now start over again with the
current prefix being just the root Q.&nbsp;&nbsp; Keep adding characters to [.c.] to form
[.c.]K, until you can't find [.c.]K in the string table.&nbsp;&nbsp; Then output the code
for [.c.] and add [.c.]K to the string table.&nbsp;&nbsp; In pseudo-code, the algorithm
goes something like this:

</p><ol>
<li>Initialize string table;
</li><li>[.c.] &lt;- empty;
</li><li>K &lt;- next character in charstream;
</li><li>Is [.c.]K in string table?
  <ul>
  <li> yes: 
    <ul>
    <li> [.c.] &lt;- [.c.]K;
    </li><li>  go to [3];
    </li></ul>
  </li><li> no: 
    <ul> 
    <li> add [.c.]K to the string table;
    </li><li> output the code for [.c.] to the codestream;
    </li><li> [.c.] &lt;- K;
    </li><li> go to [3];
    </li></ul>
  </li></ul>
</li></ol>


<p>
  It's as simple as that!&nbsp;&nbsp; Of course, when you get to step [3] and there
aren't any more characters left, you just output the code for [.c.] and throw
the table away.&nbsp;&nbsp; You're done.

</p><p>
 Wanna do an example?&nbsp;&nbsp; Let's pretend we have a four-character alphabet:&nbsp;&nbsp;
A,B,C,D.&nbsp;&nbsp; The charstream looks like ABACABA.&nbsp;&nbsp; Let's compress it.&nbsp;&nbsp; First, we
initialize our string table to:&nbsp;&nbsp; #0=A, #1=B, #2=C, #3=D.&nbsp;&nbsp; The first character is
A, which is in the string table, so [.c.] becomes A.&nbsp;&nbsp; Next we get AB, which is
not in the table, so we output code #0 (for [.c.]),
and add AB to the string table as code #4. [.c.] becomes B.&nbsp;&nbsp; Next we get
[.c.]A = BA, which is not in the string table, so output code #1, and add BA
to the string table as code #5. [.c.] becomes A.&nbsp;&nbsp; Next we get AC, which is not
in the string table.&nbsp;&nbsp; Output code #0, and add AC to the string table as code
#6. Now [.c.] becomes C.&nbsp;&nbsp; Next we get [.c.]A = CA, which is not in the table.&nbsp;&nbsp;
Output #2 for C, and add CA to table as code#7.&nbsp;&nbsp; Now [.c.] becomes A.&nbsp;&nbsp; Next we
get AB, which IS in the string table, so [.c.] gets AB, and we look at ABA,
which is not in the string table, so output the code for AB, which is #4, and
add ABA to the string table as code #8. [.c.] becomes A.&nbsp;&nbsp; We can't get any more
characters, so we just output #0 for the code for A, and we're done.&nbsp;&nbsp; So, the
codestream is #0#1#0#2#4#0.

</p><p>
 A few words (four) should be said here about efficiency:&nbsp;&nbsp; use a hashing
strategy.&nbsp;&nbsp; &nbsp; The search through the string table can be computationally
intensive, and some hashing is well worth the effort.&nbsp;&nbsp; Also, note that
"straight LZW" compression runs the risk of overflowing the string table -
getting to a code which can't be represented in the number of bits you've set
aside for codes.&nbsp;&nbsp; There are several ways of dealing with this problem, and GIF
implements a very clever one, but we'll get to that.&nbsp;&nbsp;

</p><p>
 An important thing to notice is that, at any point during the
compression, if [...]K is in the string table, [...] is there also.&nbsp;&nbsp; This fact
suggests an efficient method for storing strings in the table.&nbsp;&nbsp; Rather than
store the entire string of K's in the table, realize that any string can be
expressed as a prefix plus a character:&nbsp;&nbsp; [...]K.&nbsp;&nbsp; If we're about to store [...]K
in the table, we know that [...] is already there, so we can just store the
code for [...] plus the final character K.

</p><p>
 Ok, that takes care of compression.&nbsp;&nbsp; Decompression is perhaps more
difficult conceptually, but it is really easier to program.

</p><p>
 Here's how it goes:&nbsp;&nbsp; We again have to start with an initialized string
table.&nbsp;&nbsp; This table comes from what knowledge we have about the charstream that
we will eventually get, like what possible values the characters can take.&nbsp;&nbsp; In
GIF files, this information is in the header as the number of possible pixel
values.&nbsp;&nbsp; The beauty of LZW, though, is that this is all we need to know.&nbsp;&nbsp; We
will build the rest of the string table as we decompress the codestream.&nbsp;&nbsp; The
compression is done in such a way that we will never encounter a code in the
codestream that we can't translate into a string.

</p><p>
 We need to define something called a "current code", which I will refer
to as "&lt;code&gt;", and an "old-code", which I will refer to as "&lt;old&gt;".&nbsp;&nbsp;
To start things off, look at the first code.&nbsp;&nbsp; This is now &lt;code&gt;.&nbsp;&nbsp; This 
code will be in the intialized string table as the code for a root.&nbsp;&nbsp; Output 
the root to the charstream.&nbsp;&nbsp; Make this code the old-code &lt;old&gt;.&nbsp;&nbsp; *Now look at
the next code, and make it &lt;code&gt;.&nbsp;&nbsp; It is possible that this code will 
not be in the string table, but let's assume for now that it is.&nbsp;&nbsp; Output the
string corresponding to &lt;code&gt; to the codestream.&nbsp;&nbsp; Now find the first 
character in the string you just translated.&nbsp;&nbsp; Call this K.&nbsp;&nbsp; Add this to the
prefix [...] generated by &lt;old&gt; to form a new string [...]K.&nbsp;&nbsp; Add this 
string [...]K to the string table, and set the old-code &lt;old&gt; to the 
current code &lt;code&gt;.&nbsp;&nbsp; Repeat from where I typed the
asterisk, and you're all set.&nbsp;&nbsp; Read this paragraph again if you just skimmed
it!!!&nbsp;&nbsp; Now let's consider the possibility that &lt;code&gt; is not in the string
table.&nbsp;&nbsp; Think back to compression, and try to understand what happens when you
have a string like P[...]P[...]PQ appear in the charstream.&nbsp;&nbsp; Suppose P[...] is
already in the string table, but P[...]P is not.&nbsp;&nbsp; The compressor will parse out
P[...], and find that P[...]P is not in the string table.&nbsp;&nbsp; It will output the
code for P[...], and add P[...]P to the string table.&nbsp;&nbsp; Then it will get up to
P[...]P for the next string, and find that P[...]P is in the table, as
the code just added.&nbsp;&nbsp; So it will output the code for P[...]P if it finds
that P[...]PQ is not in the table.&nbsp;&nbsp; The decompressor is always "one step
behind" the compressor.&nbsp;&nbsp; When the decompressor sees the code for P[...]P, it
will not have added that code to it's string table yet because it needed the
beginning character of P[...]P to add to the string for the last code, P[...],
to form the code for P[...]P.&nbsp;&nbsp; However, when a decompressor finds a code that
it doesn't know yet, it will always be the very next one to be added to the
string table.&nbsp;&nbsp; So it can guess at what the string for the code should be, and,
in fact, it will always be correct.&nbsp;&nbsp; If I am a decompressor, and I see
code#124, and yet my string table has entries only up to code#123, I can
figure out what code#124 must be, add it to my string table, and output the
string.&nbsp;&nbsp; If code#123 generated the string, which I will refer to here as a
prefix, [...], then code#124, in this special case, will be [...] plus the
first character of [...].&nbsp;&nbsp; So just add the first character of [...] to the end
of itself.&nbsp;&nbsp; Not too bad.&nbsp;&nbsp;  As an example (and a very common one) of this special
case, let's assume we have a raster image in which the first three pixels have
the same color value.&nbsp;&nbsp; That is, my charstream looks like:&nbsp;&nbsp; QQQ....&nbsp;&nbsp; For the sake
of argument, let's say we have 32 colors, and Q is the color#12.&nbsp;&nbsp; The
compressor will generate the code sequence 12,32,.... (if you don't know why,
take a minute to understand it.)&nbsp; Remember that #32 is not in the initial
table, which goes from #0 to #31.&nbsp;&nbsp; The decompressor will see #12 and translate
it just fine as color Q.&nbsp;&nbsp; Then it will see #32 and not yet know what that
means.&nbsp;&nbsp; But if it thinks about it long enough, it can figure out that QQ should
be entry#32 in the table and QQ should be the next string output.&nbsp;&nbsp;  So the
decompression pseudo-code goes something like:

</p><ol>
<li> Initialize string table;
</li><li> get first code: &lt;code&gt;;
</li><li> output the string for &lt;code&gt; to the charstream;
</li><li> &lt;old&gt; = &lt;code&gt;;
</li><li> &lt;code&gt; &lt;- next code in codestream;
</li><li> does &lt;code&gt; exist in the string table?
  <ul>
  <li> yes: 
    <ul> 
    <li> output the string for &lt;code&gt; to the charstream;
    </li><li> [...] &lt;- translation for &lt;old&gt;;
    </li><li> K &lt;- first character of translation for &lt;code&gt;;
    </li><li> add [...]K to the string table;
    </li><li> &lt;old&gt; &lt;- &lt;code&gt;;
    </li></ul>
  </li><li>no: 
    <ul>
    <li> [...] &lt;- translation for &lt;old&gt;;
    </li><li> K &lt;- first character of [...];
    </li><li> output [...]K to charstream and add it to string table;
    </li><li> &lt;old&gt; &lt;- &lt;code&gt;
    </li></ul>
  </li></ul>
</li><li> go to [5];
</li></ol>

<p> 
Again, when you get to step [5] and there are no more codes, you're
finished.&nbsp;&nbsp;  Outputting of strings, and finding of initial characters in strings
are efficiency problems all to themselves, but I'm not going to suggest ways
to do them here.&nbsp;&nbsp; Half the fun of programming is figuring these things out!&nbsp;&nbsp;

</p><p>
<b>Now for the GIF variations on the theme.&nbsp;&nbsp;</b>
In part of the header of a GIF
file, there is a field, in the Raster Data stream, called "code size".&nbsp;&nbsp; This is
a very misleading name for the field, but we have to live with it.&nbsp;&nbsp; What it is
really is the "root size".&nbsp;&nbsp; The actual size, in bits, of the compression codes
actually changes during compression/decompression, and I will refer to that
size here as the "compression size".&nbsp;&nbsp; The initial table is just the codes for
all the roots, as usual, but two special codes are added on top of those.&nbsp;&nbsp;
Suppose you have a "code size", which is usually the number of bits per pixel
in the image, of N.&nbsp;&nbsp; If the number of bits/pixel is one, then N must be 2:&nbsp;&nbsp; the
roots take up slots #0 and #1 in the initial table, and the two special codes
will take up slots #4 and #5.&nbsp;&nbsp; In any other case, N is the number of bits per
pixel, and the roots take up slots #0 through #(2**N-1), and the special codes
are (2**N) and (2**N + 1).&nbsp;&nbsp; The initial compression size will be N+1 bits per
code.&nbsp;&nbsp; If you're encoding, you output the codes (N+1) bits at a time to start
with, and if you're decoding, you grab (N+1) bits from the codestream at a
time.&nbsp;&nbsp;  As for the special codes:&nbsp;&nbsp; &lt;CC&gt; or the clear code, is (2**N), and 
&lt;EOI&gt;, or end-of-information, is (2**N + 1).&nbsp;&nbsp; &lt;CC&gt; tells the compressor 
to re-initialize the string table, and to reset the compression size to (N+1).&nbsp;&nbsp;
&lt;EOI&gt; means there's no more in the codestream.&nbsp;&nbsp;  If you're encoding or 
decoding, you
should start adding things to the string table at &lt;CC&gt; + 2.&nbsp;&nbsp; If you're
encoding, you should output &lt;CC&gt; as the very first code, and then whenever
after that you reach code #4095 (hex FFF), because GIF does not allow
compression sizes to be greater than 12 bits.&nbsp;&nbsp; If you're decoding, you should
reinitialize your string table when you observe &lt;CC&gt;.&nbsp;&nbsp;  The variable
compression sizes are really no big deal.&nbsp;&nbsp; If you're encoding, you start with a
compression size of (N+1) bits, and, whenever you output the code
(2**(compression size)-1), you bump the compression size up one bit.&nbsp;&nbsp; So the
next code you output will be one bit longer.&nbsp;&nbsp; Remember that the largest
compression size is 12 bits, corresponding to a code of 4095.&nbsp;&nbsp; If you get that
far, you must output &lt;CC&gt; as the next code, and start over.&nbsp;&nbsp;  If you're
decoding, you must increase your compression size AS SOON AS YOU write entry
#(2**(compression size) - 1) to the string table.&nbsp;&nbsp; The next code you READ will
be one bit longer.&nbsp;&nbsp; Don't make the mistake of waiting until you need to add the
code (2**compression size) to the table.&nbsp;&nbsp; You'll have already missed a bit from
the last code.&nbsp;&nbsp;  The packaging of codes into a bitsream for the raster data is a potential stumbling block for the novice encoder or decoder.&nbsp;&nbsp; The lowest
order bit in the code should coincide with the lowest available bit in the
first available byte in the codestream.&nbsp;&nbsp; For example, if you're starting with
5-bit compression codes, and your first three codes are, say, &lt;abcde&gt;,
&lt;fghij&gt;, &lt;klmno&gt;, where e, j, and o are bit#0, then your codestream 
will start off like:

</p><pre>      byte#0: hijabcde
      byte#1: .klmnofg
</pre>

So the differences between straight LZW and GIF LZW are:&nbsp;&nbsp; two additional
special codes and variable compression sizes.&nbsp;&nbsp; If you understand LZW, and you
understand those variations, you understand it all!

<p>
<a name="P.S.">Just as sort of a P.S.</a>, you may have noticed that a compressor has a
little bit of flexibility at compression time.&nbsp;&nbsp; I specified a "greedy" approach
to the compression, grabbing as many characters as possible before outputting
codes.&nbsp;&nbsp; This is, in fact, the standard LZW way of doing things, and it will
yield the best compression ratio.&nbsp;&nbsp; But there's no rule saying you can't stop
anywhere along the line and just output the code for the current prefix,
whether it's already in the table or not, and add that string plus the next
character to the string table.&nbsp;&nbsp; There are various reasons for wanting to do
this, especially if the strings get extremely long and make hashing difficult.&nbsp;&nbsp;
If you need to, do it.

</p><p>
Hope this helps out.&nbsp;&nbsp;----steve blackstock

</p><hr>
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/download.html">Download Whirlgif</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/whirlgifman.html">Whirlgif Manual</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/examples.html">Examples</a>]
 [LZW explained]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gif87.html">GIF 87a Spec</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/gif89.html">GIF 89a Spec</a>]
 [<a href="http://web.archive.org/web/20050217131148/http://www.danbbs.dk/~dino/whirlgif/index.html">Whirlgif 3.x Homepage</a>]
<hr>
<center><address>
<font size="-1">www.danbbs.dk/~dino/whirlgif/lzw.html</font></address>
</center>



 
<!--
     FILE ARCHIVED ON 13:11:48 Feb 17, 2005 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 14:45:04 Sep 06, 2020.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
-->
<!--
playback timings (ms):
  PetaboxLoader3.datanode: 171.724 (4)
  LoadShardBlock: 454.816 (3)
  RedisCDXSource: 1.576
  esindex: 0.014
  exclusion.robots: 0.435
  exclusion.robots.policy: 0.412
  PetaboxLoader3.resolve: 105.327 (2)
  CDXLines.iter: 21.693 (3)
  captures_list: 486.797
  load_resource: 102.285
--></body></html>